<ion-view ng-init="init()">
  <ion-nav-bar class="bar-positive bar" align-title="center">
    <ion-nav-back-button ng-click="klyBack()"></ion-nav-back-button>
    <ion-nav-title>
      <button class="tab-btn button nav-btn-left" ng-class="filterState === 1 ? 'current': ''" ng-click="filterWaybills(1)">进行中</button>
      <button class="tab-btn button nav-btn-right" ng-class="filterState === 2 ? 'current': ''" ng-click="filterWaybills(2)">已完成</button>
    </ion-nav-title>
    <ion-nav-buttons side="right">
      <button class="button" ng-click="refresh()">刷新</button>
    </ion-nav-buttons>
    <!--<ion-nav-buttons class="button-center">-->
      <!-- -->
    <!--</ion-nav-buttons>-->
  </ion-nav-bar>
  <ion-content class="gray_back">
    <section class="g_main">
      <!-- 订单信息列表 -->
      <ul class="tab_back" ng-if="userInfo.member_type === 1 || userInfo.member_type === 3">
        <li ng-class="tab_class[0]" ng-click="selectwaybilltype(0)">整车/船运单</li>
        <li ng-class="tab_class[1]" ng-click="selectwaybilltype(1)">专线运单</li>
        <i ng-class="scrollclass"></i>
      </ul>
      <section class="order_list">
        <p ng-if="nowaybill" style="text-align: center">暂无运单数据</p>
        <ion-scroll style="height:{{scorllHeight}}px" delegate-handle="waybillscroll">
        <div style="height:{{listHeight}}px">
        <ion-list ng-if="wayBillList && wayBillList.length">
          <li ng-click="toWaybillDetail(item.waybill_id || item.linebill_id)" ng-repeat="item in wayBillList" class="item">
            <header><strong>订单编号： {{item.waybill_id || item.linebill_id}}</strong><em class="status">{{item.state_disp}}</em></header>
            <ul>
              <li>
                <i class="icon icon_order_1"></i>
                <span>装货日期</span>
                <em>{{item.shipment_time_disp}}</em>
              </li>
              <li>
                <i class="icon icon_order_2"></i>
                <span>装货地点</span>
                <em>{{item.start_area_disp}}</em>
                <button class="btn_pos" ng-click="applyInvoice(item.waybill_id || item.linebill_id, $event)" ng-if="tab_class[0].indexOf('active') > -1 && item.state >= 6 && userInfo.member_type !== 2">申请发票</button>
              </li>
              <li>
                <i class="icon icon_order_3"></i>
                <span>终点</span>
                <em>{{item.end_area_disp}}</em>
                <button class="btn_pos" ng-click="towaybillpos(item.waybill_id || item.linebill_id, $event)" ng-if="tab_class[0].indexOf('active') > -1 && item.state >= 2 && userInfo.member_type !== 2">位置</button>
              </li>
              <!--<li>-->
                <!--<i class="icon icon_order_4"></i>-->
                <!--<span>运价</span>-->
                <!--<em><span>{{item.price}}</span>元</em>-->
              <!--</li>-->
              <li ng-if="tab_class[0].indexOf('active') > -1">
                <i class="icon icon_order_4"></i>
                <span>保证金</span>
                <em><span>{{item.deposit}}</span>元</em>
              </li>
              <li>
                <i class="icon icon_order_5"></i>
                <span>货物名称</span>
                <em>{{item.cargo_name}}</em>
              </li>
            </ul>
          </li>
        </ion-list>
        <ion-infinite-scroll on-infinite="loadMoreRecord()" distance="1" ng-show="showprogress"></ion-infinite-scroll>
        </div>
        </ion-scroll>
      </section>
    </section>
  </ion-content>
</ion-view>
